//
//  MSHomeTableViewController.m
//  SocietySale
//
//  Created by yumingwei on 2016/11/6.
//  Copyright © 2016年 Mike. All rights reserved.
//

#import "MSHomeTableViewController.h"
#import "MSHomeCell.h"
@interface MSHomeTableViewController ()

@end

@implementation MSHomeTableViewController

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSString *cellId = @"cellId";
    MSHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell) {
        cell = [[MSHomeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId];
//        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.model = self.dataArray[indexPath.row];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return [MSHomeCell cellHeightWithModel:self.dataArray[indexPath.row]];
}

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
    if ([self.delegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]) {
        [self.delegate performSelector:@selector(scrollViewWillBeginDragging:) withObject:self];
    }
}

@end
